<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.6"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>San11PK: pk::detail::arrayptr&lt; T &gt; 模板类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">San11PK<span id="projectnumber">&#160;2.2</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.6 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacepk.html">pk</a></li><li class="navelem"><a class="el" href="namespacepk_1_1detail.html">detail</a></li><li class="navelem"><a class="el" href="classpk_1_1detail_1_1arrayptr.html">arrayptr</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#pub-attribs">Public 属性</a> &#124;
<a href="classpk_1_1detail_1_1arrayptr-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">pk::detail::arrayptr&lt; T &gt; 模板类 参考</div></div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="pk__types_8h_source.html">pk_types.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:ad6a407e97a8fd4b3a4a726aa1f29aa98"><td class="memItemLeft" align="right" valign="top">T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpk_1_1detail_1_1arrayptr.html#ad6a407e97a8fd4b3a4a726aa1f29aa98">operator[]</a> (<a class="el" href="pk__types_8h.html#a4f5fce8c1ef282264f9214809524d836">uint</a>)</td></tr>
<tr class="separator:ad6a407e97a8fd4b3a4a726aa1f29aa98"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd92f9f1efe5d43468fd317ab28dafe8"><td class="memItemLeft" align="right" valign="top">const T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpk_1_1detail_1_1arrayptr.html#afd92f9f1efe5d43468fd317ab28dafe8">operator[]</a> (<a class="el" href="pk__types_8h.html#a4f5fce8c1ef282264f9214809524d836">uint</a>) const</td></tr>
<tr class="separator:afd92f9f1efe5d43468fd317ab28dafe8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-attribs" name="pub-attribs"></a>
Public 属性</h2></td></tr>
<tr class="memitem:aa8584ae0a20f227e5683a34969a946e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="pk__types_8h.html#a524c03ebef1870cbf6ecc94a8c7adbfb">PROPERTY</a> const int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classpk_1_1detail_1_1arrayptr.html#aa8584ae0a20f227e5683a34969a946e9">length</a></td></tr>
<tr class="separator:aa8584ae0a20f227e5683a34969a946e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><div class="compoundTemplParams">template&lt;typename T&gt;<br />
class pk::detail::arrayptr&lt; T &gt;</div><p>value 类型. 这是一种包装一维数组指针的类型，仅在set_func和bind回调的参数中使用。 这是创建的类型，因为要转换为脚本支持的数组类型很麻烦。 </p><div class="fragment"><div class="line"><span class="keywordtype">int</span> arr[3];</div>
<div class="line">asIScriptEngine* engine;</div>
<div class="line">asIScriptContext* context;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// 产生不必要的内存分配。连类型都要指定的麻烦。</span></div>
<div class="line">CScriptArray* arr2 = CScriptArray::Create(engine-&gt;GetTypeInfoByDecl(<span class="stringliteral">&quot;array&lt;int&gt;&quot;</span>), 3);</div>
<div class="line"><span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i &lt; 3; i++)</div>
<div class="line">    arr2-&gt;SetValue(i, &amp;arr[i]);</div>
<div class="line">context-&gt;SetArgObject(0, arr2);</div>
<div class="line">context-&gt;Execute();</div>
<div class="line">arr2-&gt;Release();</div>
<div class="line"> </div>
<div class="line"><span class="comment">// 非常简单!</span></div>
<div class="line"><a class="code hl_class" href="classpk_1_1detail_1_1arrayptr.html">arrayptr</a> arr3 = <a class="code hl_class" href="classpk_1_1detail_1_1arrayptr.html">arrayptr</a>(arr, <span class="keyword">sizeof</span>(<span class="keywordtype">int</span>), 3);</div>
<div class="line">context-&gt;SetArgObject(0, &amp;arr3);</div>
<div class="line">context-&gt;Execute();</div>
<div class="ttc" id="aclasspk_1_1detail_1_1arrayptr_html"><div class="ttname"><a href="classpk_1_1detail_1_1arrayptr.html">pk::detail::arrayptr</a></div><div class="ttdef"><b>Definition:</b> pk_types.h:73</div></div>
</div><!-- fragment --> </div><h2 class="groupheader">成员函数说明</h2>
<a id="ad6a407e97a8fd4b3a4a726aa1f29aa98" name="ad6a407e97a8fd4b3a4a726aa1f29aa98"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad6a407e97a8fd4b3a4a726aa1f29aa98">&#9670;&#160;</a></span>operator[]() <span class="overload">[1/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">T &amp; <a class="el" href="classpk_1_1detail_1_1arrayptr.html">pk::detail::arrayptr</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pk__types_8h.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a id="afd92f9f1efe5d43468fd317ab28dafe8" name="afd92f9f1efe5d43468fd317ab28dafe8"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afd92f9f1efe5d43468fd317ab28dafe8">&#9670;&#160;</a></span>operator[]() <span class="overload">[2/2]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname">const T &amp; <a class="el" href="classpk_1_1detail_1_1arrayptr.html">pk::detail::arrayptr</a>&lt; T &gt;::operator[] </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="pk__types_8h.html#a4f5fce8c1ef282264f9214809524d836">uint</a>&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<h2 class="groupheader">类成员变量说明</h2>
<a id="aa8584ae0a20f227e5683a34969a946e9" name="aa8584ae0a20f227e5683a34969a946e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8584ae0a20f227e5683a34969a946e9">&#9670;&#160;</a></span>length</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="pk__types_8h.html#a524c03ebef1870cbf6ecc94a8c7adbfb">PROPERTY</a> const int <a class="el" href="classpk_1_1detail_1_1arrayptr.html">pk::detail::arrayptr</a>&lt; T &gt;::length</td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li><a class="el" href="pk__types_8h_source.html">pk_types.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
制作者&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.6
</small></address>
</body>
</html>
